
#include <stdio.h>
#include <unistd.h>
#include <linux/getprocinfo.h>
#include "print_task.h"


int main() {


  printf("\nThis program will use a lot of user time.");
  printf("\nIt calls increments and decrements repeatedly");
  printf("\n in n a loop, and then, after it's done, ");
  printf("\nprints its task_info_struct information.\n\n");

  printf("\nMy Pid is:  %ld ", (long)getpid() );

  printf("\n\nSpinning . . .\n");
  int i;
  for (i = 0; i < 100000000; i++) {
    
    i = i + 5;
    i = i - 5;
    
  }
 
  printf("\nHere is my task_info_struct information: ");
  struct proc_info_struct s;
  getprocinfo( 0, &s );

  print_task( &s );
   

  printf("\nExiting.\n");
  
  return 0;
}
